<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    *{
        padding: 0;
        margin: 0;
    }
    #s1{
        width: 500px;
        height: 500px;
        font-size: 40px;
        text-align: center;
        line-height: 500px;
        
        color: white;
        background-color: red;
        margin: 0 auto;
    }
    </style>
</head>
<body>
    <div id="s1">
单击！！
    </div>
</body>
<script>
var oDiv=document.getElementById('s1');
var clickTimer=0;
oDiv.onclick=function(){
    switch(clickTimer%4){
        case 1:
        this.style.backgroundColor='lightgrey';
        this.innerText='再次点击';
        break;
        case 2:
        this.style.backgroundColor='oranged';
        this.innerText='再点击';
        break; 
        case 3:
        this.style.backgroundColor='blue';
        this.innerText='真的没了';
        break;
        default:
        this.style.backgroundColor='black';
        this.innerText='点击有惊喜哦';
    }
    clickTimer++;
}
</script>
</html>